package com.example.validproject.entity;

import com.example.validproject.valid.ParamValid;
import com.example.validproject.valid.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author kh
 * Created by on  2021-09-27 15:16
 */
@Data
public class Person {

    @NotNull(message = "主键ID不能为空",groups = {UpdateGroup.class})
    private Long id;

    @NotBlank(message = "名字不能为空")
    private String name;

    @NotNull(message = "年龄不能为空")
    private Integer age;

    @NotNull(message = "如果是老师的情况下，不能为空",groups = {ParamValid.Teacher.class})
    private Boolean isTeacher;

    @NotNull(message = "如果是学生的情况下，不能为空",groups = {ParamValid.Student.class})
    private Boolean isStudent;

    @NotNull(message = "如果是学生身份的助理的情况下，不能为空",groups = {ParamValid.Teacher.class,ParamValid.Student.class})
    private Boolean isAssistant;
}
